﻿namespace Devonline.Entity;

/// <summary>
/// 字符串类型的默认基类
/// </summary>
public abstract class EntitySetWithKeyValuePair : EntitySetWithKeyValuePair<string>, IKeyValuePair, IEntitySet, IEntitySetWithCreate { }

/// <summary>
/// 键值对存储数据的基类
/// epplus 自动导出的列头仅支持 DisplayName 和 Description 特性
/// </summary>
public abstract class EntitySetWithKeyValuePair<TKey> : EntitySetWithCreate<TKey>, IKeyValuePair<TKey>, IEntitySet<TKey>, IEntitySetWithCreate<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 序号
    /// </summary>
    [Column("index"), DisplayName("序号"), Unique, Excel]
    public virtual int Index { get; set; }
    /// <summary>
    /// 键
    /// </summary>
    [Column("key"), DisplayName("键"), Required, Unique, MaxLength(128), Excel]
    public virtual string? Key { get; set; }
    /// <summary>
    /// 值
    /// </summary>
    [Column("value"), DisplayName("值"), Required, MaxLength(256), Excel]
    public virtual string? Value { get; set; }
}